package com.logicfishsoftware.wolfgo.meta;

import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.object.ObjectConnection;

import com.logicfishsoftware.wolfgo.api.VirtualFileSystem;
import com.logicfishsoftware.wolfgo.api.VirtualFileSystemException;
import com.logicfishsoftware.wolfgo.api.VirtualFileSystemProvider;
import com.logicfishsoftware.wolfgo.meta.impl.SemanticFileSystem;
/**
 * Public factory class used to create instances of the object
 * repository based file-system, {@link SemanticFileSystem}.
 *   
 * @author logicfish@gmail.com
 *
 */
public class SemanticFileSystemProvider implements VirtualFileSystemProvider {
	public interface SemanticFileSystemHandler extends VirtualFileSystem.Handler {
		ObjectConnection getConnection(VirtualFileSystem fileSystem) throws RepositoryException;
		void disposeConnection(ObjectConnection connection) throws RepositoryException;
		void rollback(VirtualFileSystemException e, ObjectConnection connection);
	}
	public static VirtualFileSystem createSemanticFS(SemanticFileSystemHandler handler) throws VirtualFileSystemException {
		return SemanticFileSystem.createFileSystem(handler);
	}
}
